<?php

namespace App\Http\Controllers\Ad;

use App\Http\Controllers\BaseController;
use App\Models\AdHierarchy;
use Illuminate\Http\Request;

class HierarchyController extends BaseController
{
    public function index(Request $request)
    {
        $param = $this->validate($request,[
            'ad_category_id' => 'required'
        ]);

       $data = AdHierarchy::query()
                          ->where('ad_category_id',$param['ad_category_id'])
                          ->where('status',1)
                          ->get();

       return $this->success($data);
    }
}
